from django.db import models

# Create your models here.


from django.db import models

from utils.base_models import BaseModel


class Daily(BaseModel):
    """
    日报模型类
    """
    tag = (
        (1, "一次通过"),
        (2, "二次通过"),
        (3, "二次以上"),
    )
    if_extension_tag = (
        (1, "是"),
        (0, "否"),
    )
    id = models.AutoField(verbose_name='id主键', primary_key=True, help_text='id主键')
    demand_id = models.IntegerField(verbose_name='需求id', unique=True,help_text='需求id',null=True)
    name = models.CharField('需求名称', max_length=500, help_text='需求名称',null=True)
    demand_time = models.IntegerField(verbose_name='需求工时', help_text='需求工时',null=True)
    version = models.CharField('项目', max_length=500, help_text='项目',null=True)
    module = models.CharField('模块', max_length=500, help_text='模块',null=True)
    product = models.CharField('产品经理', max_length=500, help_text='产品经理',null=True)
    review_time = models.CharField('评审时间', max_length=500, help_text='评审时间',null=True)
    status = models.CharField('需求状态', max_length=500, help_text='需求状态',null=True)
    tester = models.CharField('测试人员', max_length=500, help_text='测试人员',null=True)
    test_time = models.DecimalField('测试工时', decimal_places=2, max_digits=65,help_text='测试工时',null=True)
    test_date = models.DateField('提测日期', help_text='提测日期',null=True)
    launch_time = models.DateField('上线时间', help_text='上线时间',null=True)
    smoking_results = models.IntegerField(verbose_name='冒烟结果', choices=tag, help_text='冒烟结果',null=True)
    if_extension = models.IntegerField(verbose_name='提测是否延期', choices=if_extension_tag, help_text='提测是否延期',
                                       default=0,null=True)
    test_schedule = models.IntegerField(verbose_name='测试进度', help_text='测试进度',default=0,null=True)
    function_case_num = models.IntegerField(verbose_name='功能用例数',help_text='功能用例数',default=0,null=True)
    automation_case_num = models.IntegerField(verbose_name='自动化用例数',help_text='自动化用例数',default=0,null=True)
    key_words = models.CharField('关键字', max_length=500, help_text='关键字',null=True,default='111')

    class Meta:
        db_table = 'tb_daily'
        verbose_name = '日报'
        verbose_name_plural = verbose_name
        ordering = ('launch_time',)